package entiy;

import android.graphics.Bitmap;
import android.util.Log;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

import util.MusicUtil;

public class MusicInfo {
    private String title;
    private String artlist;
    private Bitmap bitmap;

    public static List<MusicInfo>getDefaultInfo() throws Exception {
        List<MusicInfo>list = new ArrayList<>();
        List<String> filepaths = MusicUtil.readDirectory();
        // Log.e("TAG", "getDefaultInfo: "+ filepaths.size() );
        int i = 0;
        for (String filepath : filepaths) {

            MusicInfo musicInfo = new MusicInfo();
            musicInfo.artlist = MusicUtil.getArt(filepath);

            musicInfo.title = MusicUtil.getTitle(filepath);

            musicInfo.bitmap = MusicUtil.getBitmap(filepath);

            list.add(musicInfo);
        }
        return list;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getArtlist() {
        return artlist;
    }

    public void setArtlist(String artlist) {
        this.artlist = artlist;
    }

    public Bitmap getBitmap() {
        return bitmap;
    }

    public void setBitmap(Bitmap bitmap) {
        this.bitmap = bitmap;
    }
}
